//
//  Product_HeadImageView.m
//  LoveTravel
//
//  Created by MS on 16-1-25.
//  Copyright (c) 2016年 Lemon. All rights reserved.
//

#import "Product_HeadImageView.h"

@interface Product_HeadImageView ()



@property (weak, nonatomic) IBOutlet UIView *bgBaseView;
@property (weak, nonatomic) IBOutlet UIView *textBaseView;
@end

@implementation Product_HeadImageView

+(instancetype)productImageViewWithXib
{
    return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner: nil options:nil] lastObject];
}

-(void)setImageArray:(NSArray *)imageArray
{
    _imageArray = imageArray;
    _adsView.imagesArray = imageArray;
    _adsView.hiddenPageView = YES;
}

-(void)awakeFromNib
{
    GSAdsView * adsView = [[GSAdsView alloc] initWithFrame:_bgBaseView.bounds];
    [self addSubview:adsView];
    
    adsView.contentMode = UIViewContentModeScaleAspectFill;
    self.adsView = adsView;
    
    
    [self bringSubviewToFront:_textBaseView];
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    _adsView.frame = self.bounds;

}

@end
